package com.qhg.saas_server.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qhg.saas_server.mapper.StoretypeMapper;
import com.qhg.saas_server.pojo.Storetype;
import com.qhg.saas_server.service.StoretypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StoretypeServiceImpl implements StoretypeService {

    @Autowired
    StoretypeMapper storetypeMapper;
    @Override
    public PageInfo SelectAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Storetype> storetypes = storetypeMapper.SelectAll();
        PageInfo<Storetype> pageInfo = new PageInfo<>(storetypes);
        return pageInfo;
    }

    @Override
    public Storetype SelectById(Integer storeTypeId) {
        return storetypeMapper.SelectById(storeTypeId);
    }

    @Override
    public void InsertStoretype(Storetype storetype) {
        storetypeMapper.InsertStoretype(storetype);
    }

    @Override
    public void UpdateStoretypeById(Storetype storetype) {
        storetypeMapper.UpdateStoretypeById(storetype);
    }

    @Override
    public void DeleteById(Integer storeTypeId) {
        storetypeMapper.DeleteById(storeTypeId);
    }
}
